package com.study.skywalking.dubbo.filter;

import org.apache.dubbo.rpc.*;
import org.apache.logging.log4j.ThreadContext;

/**
 * Created by zhangbo on 2020/6/8.
 */
public class DubboConsumerFilter implements Filter {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        invocation.setAttachment("myTraceId", ThreadContext.get("myTraceId"));
        Result invoke = invoker.invoke(invocation);
        return invoke;
    }

}
